import { request } from '@/utils/request';
import Api from '@/core/permission/modules/org/orgs';
/**
 * @description 获取组织信息
 * @returns
 */
export function getOrgData() {
  return request({
    url: Api.orgData,
    method: 'get',
  });
}
/**
 * @description 获取组织列表
 * @returns
 */
export function getOrgList() {
  return request({
    url: Api.list,
    method: 'get',
  });
}

/**
 * @description 删除组织
 * @returns
 */
export function deleteOrg(data) {
  return request(
    {
      url: Api.delete,
      method: 'post',
      data,
    },
    {
      successMsg: '删除成功',
    },
  );
}

/**
 * @description 更新组织
 * @returns
 */
export function updateOrg(data) {
  return request({
    url: Api.update,
    method: 'post',
    data,
  });
}

/**
 * @description 创建组织
 * @returns
 */
export function createOrg(data) {
  return request({
    url: Api.add,
    method: 'post',
    data,
  });
}
